package com.daka.service.impl;

import com.daka.dao.SocialActivityMapper;
import com.daka.entity.SocialActivity;
import com.daka.service.SocialActivityService;
import com.daka.tools.Clock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by yangx
 * CreateTime: 2016/9/13 17:06
 */
@Service("socialActivityService")
@Transactional
public class SocialActivityServiceImpl implements SocialActivityService {

    @Autowired
    private SocialActivityMapper socialActivityMapper;


    public int insert(SocialActivity po) {
        po.setCreateTime(Clock.DEFAULT.getCurrentDate());
        return socialActivityMapper.insert(po);
    }

    @Override
    public int update(SocialActivity po) {
        return socialActivityMapper.updateByPrimaryKeySelective(po);
    }

    @Override
    public SocialActivity selectByPrimaryKey(Long id) {
        return socialActivityMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<SocialActivity> selectByStatement(SocialActivity record){
        return socialActivityMapper.selectByStatement(record);
    }
}
